﻿using System.Configuration;

namespace Eswat.Configuration
{
	/// <summary>
	/// 
	/// </summary>
	public class ServiceConfigurationElement : ConfigurationElement
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="ServiceConfigurationElement"/> class.
		/// </summary>
		public ServiceConfigurationElement()
		{
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="ServiceConfigurationElement"/> class.
		/// </summary>
		/// <param name="name">The name.</param>
		public ServiceConfigurationElement(string name)
		{
			this.Name = name;
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="ServiceConfigurationElement"/> class.
		/// </summary>
		/// <param name="name">The name.</param>
		/// <param name="type">The type.</param>
		public ServiceConfigurationElement(string name, string type)
		{
			this.Name = name;
			this.Type = type;
		}

		/// <summary>
		/// Gets or sets the name.
		/// </summary>
		/// <value>
		/// The name.
		/// </value>
		[ConfigurationProperty("name",
			  DefaultValue = "",
			  IsRequired = true,
			  IsKey = true)]
		public string Name { get { return (string)this["name"]; } set { this["name"] = value; } }

		/// <summary>
		/// Gets or sets the type.
		/// </summary>
		/// <value>
		/// The type.
		/// </value>
		[ConfigurationProperty("type",
			  DefaultValue = "",
			  IsRequired = true)]
		public string Type { get { return (string)this["type"]; } set { this["type"] = value; } }
	}
}
